using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace Galaktika.BI.Extensibility.Dom.Dac
{
    using Galaktika.BI.Extensibility;

    [XmlRoot(Namespace = Galaktika.BI.Silverlight.Common.Namespace)]
    public class BrickConnection : BrickObject
    {
        public const string CONNECT_LAST_DATA_UPDATE = "CONNECT_LAST_DATA_UPDATE";
        public const string CONNECT_LAST_SCHEMA_UPDATE = "CONNECT_LAST_SCHEMA_UPDATE";
        public const string CONNECT_SESSION_ID = "CONNECT_SESSION_ID";

        public BrickConnection()
        {
        }

        public BrickConnection(
            string name, 
            string title,
            DataProvider provider, 
            string connectionString,
            string httpPump)
            : base(name, title)
        {
            this.Provider = provider;
            this.ConnectionString = connectionString;
            this.HttpPump = httpPump;
        }

        public string HttpPump { get; set; }

        protected void SetHttpPumpInternal(string value)
        {
            this.HttpPump = value;
        }

        public DataProvider Provider { get; set; }

        public virtual string ConnectionString { get; set; }

        protected void SetConnectionStringInternal(string value)
        {
            this.ConnectionString = value;
        }

        protected string GetConnectionStringInternal()
        {
            return this.ConnectionString;
        }
    }
}
